﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Core;
using Core.Factory;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Model;
using NLog;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace WebApp.ApiControllers
{
    /// <summary>
    /// 参与活动管理
    /// </summary>
    [Route("api/[controller]")]
    public class JoinController : Controller
    {
        private readonly IBaseService _baseService;
        private readonly IActivityService _activityService;
        private readonly IJoinService _joinService;
        private IHostingEnvironment hostingEnv;
        private readonly Logger log = LogManager.GetCurrentClassLogger();
        /// <summary>
        /// 
        /// </summary>
        /// <param name="baseService"></param>
        /// <param name="env"></param>
        /// <param name="activityService"></param>
        /// <param name="joinService"></param>
        public JoinController(IBaseService baseService, IHostingEnvironment env, IActivityService activityService, IJoinService joinService)
        {
            _baseService = baseService;
            hostingEnv = env;
            _joinService = joinService;
            _activityService = activityService;
        }

        /// <summary>
        /// Get
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

        /// <summary>
        /// Get
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet("{id}")]
        public string Get(int id)
        {
            _baseService.GetModel<T_Activity>(i => i.Id == id);


            return "value";
        }

        /// <summary>
        /// Post
        /// </summary>
        /// <param name="value"></param>
        [HttpPost]
        public void Post([FromBody]string value)
        {
        }

        /// <summary>
        /// Put
        /// </summary>
        /// <param name="id"></param>
        /// <param name="value"></param>
        [HttpPut("{id}")]
        public void Put(int id, [FromBody]string value)
        {
        }

        /// <summary>
        /// Delete
        /// </summary>
        /// <param name="id"></param>
        [HttpDelete("{id}")]
        public void Delete(int id)
        {
        }
    }
}
